package cn.xuchunh.exam;

import java.util.Scanner;

public class ReplaceChar {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        StringBuilder result = new StringBuilder();
        char[] source = s.toCharArray();
        for (int i = 0; i < source.length; i++) {
            if(source[i] >='0' && source[i] <= '9'){
                continue;
            }
            if('A' <= source[i] && source[i] <= 'Z') {
                source[i] = toLowCase(source[i]);
            }
            if(source[i] == 'a') {
                result.append("*#");
                i++;
                for (; i < source.length; i++) {
                    if(source[i] >='0' && source[i] <= '9'){
                        i++;
                        break;
                    }
                    if('A' <= source[i] && source[i] <= 'Z') {
                        source[i] = toLowCase(source[i]);
                    }
                    if(source[i] == 'a') {
                        result.append("#");
                    }else {
                        i--;
                        break;
                    }
                }
                result.append("*");
            }else {
                result.append(source[i]);
            }
        }
        System.out.println(result.toString());
    }

    private static char toLowCase(char source) {
        return (char) (source - ('A' - 'a'));
    }

}
